#include "bshow.h"
#include <stdio.h>
template <class T1> 
void showblock(short *blk) {
  int i, j;
  for (i=0; i<8; ++i) {
    printf("     ");
    for (j=0; j<8; j++) {
      printf("%6d", (T1) blk[j + i*8]);
    }
    printf("\n");
  }
  printf("\n");
}

template <class T1> 
void showhuffifo(fifo<T1> *b1, fifo<T1> *b2) {
  int   ptr1, ptr2;

  ptr1 = b1->rptr;
  ptr2 = b2->rptr;

  while (ptr1 != b1->wptr) {
    printf("*** INFO: BB(%d,%d)\n", (T1) b1->data[ptr1], (T1) b2->data[ptr2]);
    ptr1 = (ptr1 + 1) % b1->size;
    ptr2 = (ptr2 + 1) % b2->size;
  }
}

template <class T1> 
void showblockfifo(fifo<T1> *b) {
  short tmp[64];
  int   ptr;
  int   c;

  ptr = b->rptr;
  
  while (ptr != b->wptr) {
    for (c=0; (c<64) && (ptr != b->wptr); ++c) {
      tmp[c] = b->data[ptr];
      ptr = (ptr + 1) % b->size;
    }
    showblock<T1>(tmp);
  }

}

